=========================================================================== BBS: The Abacus * HST/DS * Potterville MI Date: 05-23-93 (17:46) Number: 22 From: AARON LAPIKAS Refer#: NONE To: ALL Recvd: NO Subj: Ymodem Conf: (35) Quick Basi --------------------------------------------------------------------------- Can someone tell me the difference between Xmodem 1K and Ymodem? I know that th ey are very similar (if not the same?), but the code for an Xmodem 1K transfer w ill not work for a Ymodem transfer. Also, I am looking to speed up my Xmodem 1K protocol. Can anyone offer any advi ce in accomplishing this? Does anyone know a faster way to calculate a 16 bit C RC than: --------------------------------------------------------------------------- FUNC TION CalcCRC& (B$, CRCHigh%, CRCLow%) 'Calculates CRC for Each Block DIM CRC AS LONG CRC = 0 'Reset for Each Text Block FOR I = 1 TO LEN(B$) 'Calculate for Length of Block ByteVal = ASC(MID$(B$, I, 1)) TestBit = ((CRC AND 32768) = 32768) XOR ((ByteVal AND 128) = 128) CRC = ((CRC AND 32767&) * 2&) IF TestBit THEN CRC = CRC XOR &H1021& TestBit = ((CRC AND 32768) = 32768) XOR ((ByteVal AND 64) = 64) CRC = ((CRC AND 32767&) * 2&) IF TestBit THEN CRC = CRC XOR &H1021& TestBit = ((CRC AND 32768) = 32768) XOR ((ByteVal AND 32) = 32) CRC = ((CRC AND 32767&) * 2&) IF TestBit THEN CRC = CRC XOR &H1021& TestBit = ((CRC AND 32768) = 32768) XOR ((ByteVal AND 16) = 16) CRC = ((CRC AND 32767&) * 2&) IF TestBit THEN CRC = CRC XOR &H1021& TestBit = ((CRC AND 32768) = 32768) XOR ((ByteVal AND 8) = 8) CRC = ((CRC AND 32767&) * 2&) IF TestBit THEN CRC = CRC XOR &H1021& TestBit = ((CRC AND 32768) = 32768) XOR ((ByteVal AND 4) = 4) CRC = ((CRC AND 32767&) * 2&) IF TestBit THEN CRC = CRC XOR &H1021& TestBit = ((CRC AND 32768) = 32768) XOR ((ByteVal AND 2) = 2) CRC = ((CRC AND 32767&) * 2&) IF TestBit THEN CRC = CRC XOR &H1021& TestBit = ((CRC AND 32768) = 32768) XOR ((ByteVal AND 1) = 1) CRC = ((CRC AND 32767&) * 2&) IF TestBit THEN CRC = CRC XOR &H1021& NEXT I CRCHigh% = (CRC \ 256) 'Break Word Down into Bytes CRCLow% = (CRC MOD 256) ' for Comparison Later ComputeCRC& = CRC 'Return the Word Value END FUNCTION --------------------------------------------------------------------------- I used to have the three lines: IF TestBit THEN CRC = CRC XOR &H1021& CRC = ((CRC AND 32767&) * 2&) TestBit = ((CRC AND 32768) = 32768) XOR ((ByteVal AND 4) = 4) in a FOR/NEXT loop, but it is slightly quicker without the loop. Any other idea s would be GREATLY appreciated. Aaron --- FMail 0.90 * Origin: BCData Programming Inc - Sharon, PA (1:2601/506.1) SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1 SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 575 950 203/23 209/209 SEEN-BY: 261/1023 280/1 390/1 396/1 15 397/2 2230/100 2440/5 3603/20